-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for CNAME delegated DKIM keys #3029
base: main
Are you sure you want to change the base?
Conversation
In order to use a DKIM public key, it has to be published in the DNS system. The most easy setup simply puts it directly into the appropriate TXT record. A more advanced setup also allows them to be delegated to some other record pointed to by a CNAME record. As an example, both variants are equivalent in terms of DKIM key validation: selector1._domainkey.example.org IN TXT "v=DKIM1; p=..." and selector1._domainkey.example.org IN CNAME "somekey.mailprovider.org." somekey.mailprovider.org IN TXT "v=DKIM1; p=..." So, the actual key management can be delegated to some other party by means of using a CNAME. This is of special importance for infrastructure automation and DKIM key rotation (we just ask the customer / domain dns owner once to add the appropriate CNAME pointing to the corresponding record on our own domain, and then we're able to modify the DKIM keys on our own without requiring the customers to update their DNS records all the time). As key rotation is a current best practice, the added CNAME support will ease the respective implementation. This commit changes the code to first check a TXT record (as before), and in addition checks a CNAME record (and if found, check the record it is referring to - up to a limit of 10 recursion steps to avoid endless recursions).
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
This would be quiet useful for those of us that need advanced setups |
its supposed to ignore things which have labels but apparently it doesn't work 👌 |
Could this enhancement be merged? This is pretty useful. |
What would it take to get this enhancement merged? We send email on behalf of several domains and we use CNAME records to delegate management of the DKIM records to us. I can help in any way I can. |
In order to use a DKIM public key, it has to be published in the DNS system. The most easy setup simply puts it directly into the appropriate TXT record. A more advanced setup also allows them to be delegated to some other record pointed to by a CNAME record.
As an example, both variants are equivalent in terms of DKIM key validation:
selector1._domainkey.example.org IN TXT "v=DKIM1; p=..."
and
selector1._domainkey.example.org IN CNAME "somekey.mailprovider.org." somekey.mailprovider.org IN TXT "v=DKIM1; p=..."
So, the actual key management can be delegated to some other party by means of using a CNAME.
This is of special importance for infrastructure automation and DKIM key rotation (we just ask the customer / domain dns owner once to add the appropriate CNAME pointing to the corresponding record on our own domain, and then we're able to modify the DKIM keys on our own without requiring the customers to update their DNS records all the time).
As key rotation is a current best practice, the added CNAME support will ease the respective implementation.
This commit changes the code to first check a TXT record (as before), and in addition checks a CNAME record (and if found, check the record it is referring to - up to a limit of 10 recursion steps to avoid endless recursions).